/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package string_processing;

/**
 *
 * @author arifnasution
 */
public class SampleStringProcessing
{
    public static void main(String args[]) {
        String sampleString = "This is sample string";
        StringBuilder stringBuilder = new StringBuilder();
        stringBuilder.append( "original string : ").append( sampleString ).append( "\n" );
        stringBuilder.append( "string processing .charAt(0) : " ).append( sampleString.charAt( 0 ) ).append( "\n" );
        stringBuilder.append( "string processing .replaceAll( \" \", \"\") : " ).append( sampleString.replaceAll( " ", "") ).append( "\n");
        stringBuilder.append( "string processing .concat( \" after concat\" ) : " ).append( sampleString.concat( " after concat" ) ).append( "\n");
        stringBuilder.append( "string processing .contains( \"sample\" ) : ").append( sampleString.contains( "sample" ) ).append( "\n" );
        stringBuilder.append( "string processing .substring( 3 ) : ").append( sampleString.substring( 3 ) ).append( "\n" );
        stringBuilder.append( "string processing .codePointAt( 1 ) : ").append( sampleString.codePointAt( 1 ) ).append( "\n");
        stringBuilder.append( "string processing .equals( \"This is sample string\" ) : ").append( sampleString.equals( "This is sample string" ) ).append( "\n");
        stringBuilder.append( "string processing .equalsIgnoreCase( \"This is sample string\" ) : ").append( sampleString.equalsIgnoreCase( "tHis is Sample string" ) ).append( "\n");
        stringBuilder.append( "string processing .toUpperCase() : ").append( sampleString.toUpperCase() );
        System.out.println(  stringBuilder.toString() );
    }
}
